com.epiphan.vga2usb
Class PixelFormat

Object
  extended bycom.epiphan.vga2usb.Enum
      extended bycom.epiphan.vga2usb.Enum.Int
          extended bycom.epiphan.vga2usb.PixelFormat
All Implemented Interfaces:
Comparable

public final class PixelFormat
extends com.epiphan.vga2usb.Enum.Int

Typesafe enumeration of the pixel formats supported by Epiphan frame grabbers.


Field Summary
static PixelFormat BGR16
          16 bits per pixel RGB format.
static PixelFormat BGR24
          24 bits per pixel RGB format.
static PixelFormat RGB16
          16 bits per pixel RGB format.
static PixelFormat RGB24
          24 bits per pixel RGB format.
static PixelFormat RGB4
          4 bits per pixel (2 pixels per byte) indexed RGB format.
static PixelFormat RGB8
          8 bits per pixel indexed RGB format.
static PixelFormat UYVY
          16 bits per pixel packed YUV format.
static PixelFormat YUYV
          16 bits per pixel packed YUV format.
 
Method Summary
 int compareTo(int key)
          Compares id of this object with the specified key for order.
 int compareTo(Object obj)
          Compares this object with the specified object for order.
 int getBpp()
          Get number of bits per pixel for this pixel format.
 String getDescription()
          Returns the description of this object.
 int getValue()
          Gets the integer value associated with this object.
 int hashCode()
          Returns the hashcode for this object.
protected static int search(java.util.List list, int key)
          Searches the list for the specified enum object using the binary search algorithm.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BGR16

public static final PixelFormat BGR16
16 bits per pixel RGB format. Each pixel has 5 bits of red and blue components and 6 bits of green component. This is the same as RGB16 with red and blue component swapped.

See Also:
RGB16

BGR24

public static final PixelFormat BGR24
24 bits per pixel RGB format. Each component occupies one byte. The order of the component in memory is blue-green-red. This is the same as RGB24 with red and blue component swapped.

See Also:
RGB24

RGB16

public static final PixelFormat RGB16
16 bits per pixel RGB format. Each pixel has 5 bits of red and blue components and 6 bits of green component. This is the same as BGR16 with red and blue component swapped.

See Also:
BGR16

RGB24

public static final PixelFormat RGB24
24 bits per pixel RGB format. Each component occupies one byte. The order of the component in memory is red-green-blue. This is the same as BGR24 with red and blue component swapped.

See Also:
BGR24

RGB4

public static final PixelFormat RGB4
4 bits per pixel (2 pixels per byte) indexed RGB format. The color table is built according to the following algorithm:
 RGB4_PAL_INDEX(r,g,b) = (
    (((b) >> 4) & 8) |
    (((g) >> 5) & 6) |
    (((r) >> 7) & 1))
 


RGB8

public static final PixelFormat RGB8
8 bits per pixel indexed RGB format. The color table is built according to the following algorithm:
 RGB8_PAL_INDEX(r,g,b) = (
    (((b) >> 5) & 0x07) |
    (((g) >> 2) & 0x38) |
    ((r) & 0xc0))
 


UYVY

public static final PixelFormat UYVY
16 bits per pixel packed YUV format. This is an 8-bit 4:2:2 Component Y'CbCr format. Each 16 bit pixel is represented by an unsigned eight bit luminance component and two unsigned eight bit chroma components. Each pair of pixels shares a common set of chroma values. The components are ordered in memory as follows: U(Cb), Y0, V(Cr), Y1.
   +-----------------------------------------------+
   |                   Pixels 0-1                  |
   +-----------------------------------------------+
   |       Increasing Address Order -->            |
   +-----------+-----------+-----------+-----------+
   |  Byte 0   |  Byte 1   |  Byte 2   |  Byte 3   |
   +-----------+-----------+-----------+-----------+
   | 8-bit U   | 8-bit Y'0 | 8-bit V   | 8-bit Y'1 |
   +-----------+-----------+-----------+-----------+
 
The luminance components have a range of [16, 235], while the chroma value has a range of [16, 240]. This format is also known as 2VUY.

See Also:
fourcc.org

YUYV

public static final PixelFormat YUYV
16 bits per pixel packed YUV format. This is an 8-bit 4:2:2 Component Y'CbCr format. Each 16 bit pixel is represented by an unsigned eight bit luminance component and two unsigned eight bit chroma components. Each pair of pixels shares a common set of chroma values. The components are ordered in memory as follows: Y0, U(Cb), Y1, V(Cr).
   +-----------------------------------------------+
   |                   Pixels 0-1                  |
   +-----------------------------------------------+
   |       Increasing Address Order -->            |
   +-----------+-----------+-----------+-----------+
   |  Byte 0   |  Byte 1   |  Byte 2   |  Byte 3   |
   +-----------+-----------+-----------+-----------+
   | 8-bit Y'0 | 8-bit U   | 8-bit Y'1 | 8-bit V   |
   +-----------+-----------+-----------+-----------+
 
The luminance components have a range of [16, 235], while the chroma value has a range of [16, 240]. This format is also known as YUY2.

See Also:
fourcc.org
Method Detail

getBpp

public int getBpp()
Get number of bits per pixel for this pixel format.

Returns:
Number of bits per pixel.

compareTo

public int compareTo(int key)
Compares id of this object with the specified key for order. Returns a negative integer, zero, or a positive integer as id of this object is less than, equal to, or greater than the specified key.

Parameters:
key - the key to be compared.
Returns:
a negative integer, zero, or a positive integer as id of this object is less than, equal to, or greater than the specified key.
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this Object.
See Also:
Comparable

compareTo

public int compareTo(Object obj)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface Comparable
Parameters:
obj - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this Object.
See Also:
Comparable

getValue

public final int getValue()
Gets the integer value associated with this object.

Returns:
The integer value that identifies this object

hashCode

public final int hashCode()
Returns the hashcode for this object.

Returns:
The hashcode for this object.

search

protected static int search(java.util.List list,
                            int key)
Searches the list for the specified enum object using the binary search algorithm. The list must be sorted.

Parameters:
list - the list to search
key - the key to search for
Returns:
index of the enum object, if it is contained in the list; otherwise, (-(insertion point) - 1).

getDescription

public final String getDescription()
Returns the description of this object.

Returns:
The description of this object.

toString

public final String toString()
Returns a string representation of this object. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Returns:
A string representation of this object.


Copyright © 2008-2012 Epiphan Systems Inc. All rights reserved.